package com.excel.analyze.controller;

import com.excel.analyze.dto.ResponseResult;
import com.excel.analyze.service.ExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author duanboyao
 * @classname ExcelController
 * @date 2025/2/26 15:30
 * @description TODO
 */
@RestController
@RequestMapping("/api/excel")
public class ExcelController {

    @Autowired
    private ExcelService excelService;

    @PostMapping("/analyzeExcel")
    public ResponseResult<List<String>> analyzeExcel(@Validated @RequestParam("file") MultipartFile file) {
        return excelService.analyzeExcel(file);
    }
}
